package bairui.international.weixin.portal.miniapp.controller.request.agent;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.model.status.State_UserAgentRequestOrder;
import bairui.international.service.Service_UserAgentRequestOrder;

/**
 *
 * 已经申请判断
 *
 * @generated
 * 
 * @see STest_C_Request_Agent_Test_Get 测试
 *
 */
@Controller
public class C_Request_Agent_Test_Get
 extends SC_Request_Agent_Test_Get 
{
	
	@Autowired private Service_UserAgentRequestOrder service_UserAgentRequestOrder;
	
	/**
	 * Get请求
	 */
	@Action(Get.class)
	@GetMapping(Get.RequestMappingValue)
	public @FomatOutput @ResponseBody Object get(
		ModelMap map, HttpServletRequest request,
		@RequestParam String skey
	) throws Exception {
		if(service_UserAgentRequestOrder.exists(it->it.user.skey.eq(skey).and(it.state.ne(State_UserAgentRequestOrder.NoPassed)))){
			return true;
		}
		return false;
	}
	

}
